<template>
  <div>
    
    <div>
      <van-nav-bar
        title="开通存管"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
      >
    
      </van-nav-bar>
    </div>
    <div>
      <small>&nbsp;您现在使用招商银行开户中...</small>
      <br><br>
       &nbsp;
        <van-uploader :afterRead="upload"></van-uploader>
        <br><br>
        <van-cell-group>
        &emsp;证件类型&emsp;&emsp;&emsp;&emsp;身份证
        </van-cell-group>
        <br><br>
        &emsp;
        客户姓名 <van-field placeholder="请输入本人姓名，核实后不可修改" v-model="form.Name"></van-field>
        <br>
        &emsp;
        身份证号 <van-field placeholder="请输入本人证件号码，核实过后不允许修改" v-model="form.BankCode"></van-field>
        <br>
        <small>&nbsp;温馨提示:<br>&nbsp;若银行卡为二类账户将会影响体现,具体账号类型可咨询发卡行</small>
        <br><br><br>
        &emsp;
        银行卡号<van-field v-model="form.CardNumber" placeholder="请输入本人储蓄卡卡号"></van-field>
        <br>&emsp;
        手机号<van-field v-model="form.Mobile" placeholder="请输入银行预留手机号"></van-field>
    <van-button round block type="info" native-type="submit" color="#1861B7" @click="register">确认协议并注册</van-button>
    </div>
    
 
  
  </div>
</template>

<script>
export default {
  data() {
    return {
      form:{Name:"",BankCode:"",CardNumber:"",Mobile:""},
      text: "",
      title: '',
    };
  },
  props: {},

  components: {},

  created() {},

  mounted() {},

  methods: {
    //返回
    onClickLeft() {
      this.$router.push("/");
    },
    // 发送新闻
    upload(file){
            //文件上传
            var formData=new FormData()
            formData.append("file",file.file)
            this.axios.post("user/fileuUpload ",formData).then((resp) => {
                //调用文字识别接口
                this.getmes()
                console.log("文明上传成功",resp)
            }).catch((err) => {
                console.log("文件上传失败",err)
            });
        },
        getmes(){
            this.axios.get("user/getCardMes").then((resp) => {
                if(resp.data.code==200){
                    alert(111)
                    this.form.Name=resp.data.name
                    this.form.BankCode=resp.data.card
                }
            }).catch((err) => {
                console.log(err)
            });
        },
        register(){
            this.axios.post("user/openbank",{
                form:this.form

            }).then((resp) => {
                    console.log("协议成功",resp)
                    alert("开户成功,正在跳转请稍后")
                    this.$router.push("/chong")
            }).catch((err) => {
                console.log("获取失败",err)
            });
        
    },
  

   
    
  },

  computed: {},

  watch: {},

  directives: {},

  filters: {},
};
</script>

<style scoped>
* {
  margin: 0;
}
</style>
